package com.mrzhou.common.constant;

import com.mrzhou.core.tool.constants.ApplicationConstant;

/**
 * 项目中的一些组件的地址
 * @author qiang.zhou
 */
public interface LaunchConstant {

    String NACOS_DEV_ADDRESS = "192.168.157.128:8848";

    String NACOS_TEST_ADDRESS = "192.168.157.128:8848";

    String NACOS_PROD_ADDRESS = "127.0.0.1:8848";

    String SENTINEL_DEV_ADDRESS = "localhost:9999";

    String SENTINEL_TEST_ADDRESS = "192.168.157.128:9999";

    String SENTINEL_PROD_ADDRESS = "127.0.0.1:9999";

    static String nacosAdd(String profile) {
        switch (profile) {
            case (ApplicationConstant.TEST_CODE) :
                return NACOS_TEST_ADDRESS;
            case (ApplicationConstant.PROD_CODE) :
                return NACOS_PROD_ADDRESS;
            default:
                return NACOS_DEV_ADDRESS;
        }
    }

    static String sentinelAddress(String profile) {
        switch (profile) {
            case (ApplicationConstant.TEST_CODE) :
                return SENTINEL_TEST_ADDRESS;
            case (ApplicationConstant.PROD_CODE) :
                return SENTINEL_PROD_ADDRESS;
            default:
                return SENTINEL_DEV_ADDRESS;
        }
    }

}
